import request from '../utils/request';
import constant from '../constant/constant'
import qs from 'qs';


/**
 * 查询验证管理委员会需要审核的列表
 */ 
export function getTechnologyExaminationList(payload){
    let option = {
        method: 'POST',
        body: payload,
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
	    },
		mode: "cors",
    } 
    return request(constant.serverUrl+'/tvs/api/verification/onvertechnology/examinationinfo/id',option)
} 

/**
 * 查询所有机构列表
 */
export function getMechanismList(){
    let option = {
        method: 'GET',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
	    },
		mode: "cors",
    } 
    return request(constant.serverUrl+'/tvs/api/mechanism/infoandstatus/list',option)
} 

/**
 * 查询所有技术申请信息及状态和阶段
 */
export function getTechnologyExaminationTableData(){
    let option = {
        method: 'GET',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
	    },
		mode: "cors",
    } 
    return request(constant.serverUrl+'/tvs/api/verification/technologyinfo/stat/list',option)
} 

/**
 * 修改技术申请的资格审核的审核状态
 */
export function updateExamination(payload){
    let option = {
        method: 'POST',
        body:qs.stringify(payload),
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
	    },
		mode: "cors",
    } 
    return request(constant.serverUrl+'/tvs/api/verification/committee/qualificationexam/update',option)
}

/**
 * 修改机构的审核状态
 */
export function updateMechanismExamination(payload){
    let option = {
        method: 'POST',
        body:qs.stringify(payload),
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
	    },
		mode: "cors",
    } 
    return request(constant.serverUrl+'/tvs/api/mechanism/committee/mechanismexamination/update',option)
}

/**
 * 修改技术申请过的各项文件的审核状态
 */
export function updateFileExamination(payload){
    let option = {
        method: 'POST',
        body:qs.stringify(payload),
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
	    },
		mode: "cors",
    } 
    return request(constant.serverUrl+'/tvs/api/verification/committee/filesexam/update',option)
}

// 查询所有验证机构列表
// get:  localhost:3000/tvs/api/mechanism/verificationmechanism/list
// 返回：字段名verificationCount为验证次数

export function getVerificationmechanismList(){
    let option = {
        method: 'GET',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
	    },
		mode: "cors",
    } 
    return request(constant.serverUrl+'/tvs/api/mechanism/verificationmechanism/list',option)
} 

// //查询所有测试机构列表
// get:  localhost:3000/tvs/api/mechanism/testmechanism/list
// 返回：字段名verificationCount为验证次数

export function getTestmechanismList(){
    let option = {
        method: 'GET',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
	    },
		mode: "cors",
    } 
    return request(constant.serverUrl+'/tvs/api/mechanism/testmechanism/list',option)
} 